package cn.com.huzo.model.entities.master;

import huzofw.model.entities.BaseEntity;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;

/**
 * 汇率实体类
 * <p>
 * @author 范学春
 */
public class ExchangeRateEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = -834681351342616188L;
    private Long ExchangeRateId;
    private Long LocalCurrency;
    private String LocalCurrencyName;
    private Long ForeignCurrency;
    private String ForeignCurrencyName;
    private Short YearOfExchangeRate;
    private Short MonthOfExchangeRate;
    private Float ExchangeRate;
    private Float OfferExchangeRate;

    /* 汇率本币 */
    //private Long CurTypeId
    public String getLocalCurrencyName() {
        return LocalCurrencyName;
    }

    public void setLocalCurrencyName(String LocalCurrencyName) {
        this.LocalCurrencyName = LocalCurrencyName;
    }

    public String getForeignCurrencyName() {
        return ForeignCurrencyName;
    }

    public void setForeignCurrencyName(String ForeignCurrencyName) {
        this.ForeignCurrencyName = ForeignCurrencyName;
    }

    public Long getExchangeRateId() {
        return ExchangeRateId;
    }

    public Long getLocalCurrency() {
        return LocalCurrency;
    }

    public Long getForeignCurrency() {
        return ForeignCurrency;
    }

    public Short getYearOfExchangeRate() {
        return YearOfExchangeRate;
    }

    public Short getMonthOfExchangeRate() {
        return MonthOfExchangeRate;
    }

    public Float getExchangeRate() {
        return ExchangeRate;
    }

    public Float getOfferExchangeRate() {
        return OfferExchangeRate;
    }

    public void setExchangeRateId(Long ExchangeRateId) {
        this.ExchangeRateId = ExchangeRateId;
    }

    public void setLocalCurrency(Long LocalCurrency) {
        this.LocalCurrency = LocalCurrency;
    }

    public void setForeignCurrency(Long ForeignCurrency) {
        this.ForeignCurrency = ForeignCurrency;
    }

    public void setYearOfExchangeRate(Short YearOfExchangeRate) {
        this.YearOfExchangeRate = YearOfExchangeRate;
    }

    public void setMonthOfExchangeRate(Short MonthOfExchangeRate) {
        this.MonthOfExchangeRate = MonthOfExchangeRate;
    }

    public void setExchangeRate(Float ExchangeRate) {
        this.ExchangeRate = ExchangeRate;
    }

    public void setOfferExchangeRate(Float OfferExchangeRate) {
        this.OfferExchangeRate = OfferExchangeRate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof ExchangeRateEntity)) {
            return false;
        }

        final ExchangeRateEntity that = (ExchangeRateEntity) o;

        return new EqualsBuilder()
            .append(this.getExchangeRateId(), that.getExchangeRateId())
            .isEquals();
    }

    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + getExchangeRateId().hashCode();

        return result;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
